if(!jsx3.lang.Class.forName("tibco.admin.enterpriseAssets.envDef.envDtls.uddi.Uddi")) {
    jsx3.Class.defineClass(
            'tibco.admin.enterpriseAssets.envDef.envDtls.uddi.Uddi', // full name of the class to create
            jsx3.gui.LayoutGrid,
            null,
            function(uddi) {

                uddi.prototype.mtxList = null;
                uddi.prototype.environmentName = null;
                uddi.prototype.entityID = null;
                uddi.prototype.instance = null;

                uddi.prototype.subscribeAll = function() {
                    this.getDescendantOfName("btnEdit27H").setEnabled(jsx3.gui.Form.STATEDISABLED, true);
                    this.mtxList = this.getDescendantOfName("mtxDeployedUddis27H");
                    this.mtxList.getDescendantOfName("colUse27H").setValueTemplate(tibco.admin.Main.getServer().getDynamicProperty("@@UDDI Enabled View Mode Value Template"));
                    this.selectBox = this.getDescendantOfName("selFilterEnable27H");
                    tibco.admin.PubSub.subscribe(tibco.admin.enterpriseAssets.envDef.EventID.ENVIRONMENT_ROW_SELECTED, this, this.subscribeSelect);
                    tibco.admin.PubSub.subscribe(tibco.admin.enterpriseAssets.sReg.uddi.EventID.ADD_OVER, this, this.callgetUDDIServersAssociatedWithEnvironment);
                    tibco.admin.PubSub.subscribe(tibco.admin.enterpriseAssets.sReg.uddi.EventID.UDDI_DELETED, this, this.callgetUDDIServersAssociatedWithEnvironment);
                    this.selectBox.setEnabled(jsx3.gui.Form.STATEDISABLED).setValue(tibco.admin.Main.getServer().getDynamicProperty("@@Filter Option All"));
                }

                uddi.prototype.unsubscribeAll = function() {
                    tibco.admin.PubSub.unsubscribe(tibco.admin.enterpriseAssets.envDef.EventID.ENVIRONMENT_ROW_SELECTED, this);
                }

                uddi.prototype.clearAll = function() {
                    this.environmentName = null;
                    this.entityID = null;
                    tibco.admin.Main.getServer().getCache().clearById(this.mtxList.getXMLId());
                    this.mtxList.repaint();
                    var editButton = this.getDescendantOfName("btnEdit27H");
                    if(this.handler && editButton.getDisplay() == jsx3.gui.Block.DISPLAYNONE) {
                        this.handler.endEditMode();
                        editButton.setDisplay(jsx3.gui.Block.DISPLAYBLOCK, true).
                                getParent().getChild("btnCancel27H").setDisplay(jsx3.gui.Block.DISPLAYNONE, true).
                                getParent().getChild("btnSave27H").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                        this.mtxList.getDescendantOfName("colUse27H").setValueTemplate(tibco.admin.Main.getServer().getDynamicProperty("@@UDDI Enabled View Mode Value Template"));
                        this.mtxList.repaintData();
                    }
                    editButton.setEnabled(jsx3.gui.Form.STATEDISABLED, true);
                    this.selectBox.setEnabled(jsx3.gui.Form.STATEDISABLED, true).setValue(tibco.admin.Main.getServer().getDynamicProperty("@@Filter Option All"));
                }

                uddi.prototype.subscribeSelect = function(objEvent) {
                    if(this.handler && this.handler.isInEditMode()) {
                        return;
                    }
                    if(objEvent.environmentName) {
                        this.environmentName = objEvent.environmentName;
                        this.entityID = objEvent.environmentID;
                        this.callgetUDDIServersAssociatedWithEnvironment();
                    }
                    else {
                        this.clearAll();
                    }
                }

                uddi.prototype.callgetUDDIServersAssociatedWithEnvironment = function() {
                    if(this.entityID && (!this.handler || !this.handler.isInEditMode())) {
                        var objService = tibco.admin.Main.loadService("tibco.admin",
                                "tibco/admin/enterpriseAssets/envDef/envDtls/uddi/rules/getUddiForEnvRules.xml",
                                "getUDDIServersAssociatedWithEnvironment",
                                "Get environments");
                        //subscribe and call

                        objService.entityID = this.entityID;
                        objService.environmentName = this.environmentName;
                        objService.subscribe(jsx3.net.Service.ON_SUCCESS, this, this.ongetUDDIServersAssociatedWithEnvironmentSuccess);
                        objService.setEndpointURL(tibco.admin.util.ServiceHelper.getUddiServerEndpointURL());
                        objService.doCall();
                    }
                };

                uddi.prototype.ongetUDDIServersAssociatedWithEnvironmentSuccess = function(objEvent) {
                    if(this.mtxList.getXML().selectNodes("//record").getLength() > 0) {
                        this.getDescendantOfName("btnEdit27H").setEnabled(jsx3.gui.Form.STATEENABLED, true);
                        this.selectBox.setEnabled(jsx3.gui.Form.STATEENABLED, true);
                    }
                    this.mtxList.repaintData();
                    this.tempCacheDoc = this.mtxList.getXML().cloneDocument();
                };

                uddi.prototype.editUDDIServer = function() {
                    var editButton = this.getDescendantOfName("btnEdit27H", true, false);
                    if(editButton.getDisplay() == jsx3.gui.Block.DISPLAYBLOCK) {
                        this.handler.beginEditMode();
                        editButton.setDisplay(jsx3.gui.Block.DISPLAYNONE, true).getParent().
                                getChild("btnSave27H").setDisplay(jsx3.gui.Block.DISPLAYBLOCK, true).
                                getParent().getChild("btnCancel27H").setDisplay(jsx3.gui.Block.DISPLAYBLOCK, true);
                        this.mtxList.getDescendantOfName("colUse27H").setValueTemplate(tibco.admin.Main.getServer().getDynamicProperty("@@UDDI Enabled Edit Mode Value Template"));
                        this.mtxList.repaintData();

                    }
                    else {
                        this.handler.endEditMode();
                        editButton.setDisplay(jsx3.gui.Block.DISPLAYBLOCK, true)
                                .getParent().getChild("btnSave27H").setDisplay(jsx3.gui.Block.DISPLAYNONE, true).
                                getParent().getChild("btnCancel27H").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                        this.mtxList.getDescendantOfName("colUse27H").setValueTemplate(tibco.admin.Main.getServer().getDynamicProperty("@@UDDI Enabled View Mode Value Template"));
                        this.mtxList.repaintData();
                    }

                }

                uddi.setToggle = function(jsxid, toToggle) {
                    var cacheNode = tibco.admin.Main.getServer().getCache().getDocument("uddiForEnv27H").selectSingleNode("//record[@jsxid='" + jsxid + "']");
                    if(cacheNode) {
                        cacheNode.setAttribute("associated", toToggle);
                    }
                }

                uddi.prototype.cancelEdit = function() {
                    this.editUDDIServer();
                    this.callgetUDDIServersAssociatedWithEnvironment();
                }

                uddi.prototype.callassociateUDDIServersWithEnvironment = function() {
                    var objService = tibco.admin.Main.loadService("tibco.admin",
                            "tibco/admin/enterpriseAssets/envDef/envDtls/uddi/rules/saveEnvironmentUddiMappingRules.xml",
                            "associateUDDIServersWithEnvironment",
                            "Associate uddi servers with environments");
                    //subscribe and call
                    objService.environmentID = this.entityID;
                    objService.environmentName = this.environmentName;
                    objService.subscribe(jsx3.net.Service.ON_SUCCESS, this, this.onassociateUDDIServersWithEnvironmentSuccess);
                    objService.setEndpointURL(tibco.admin.util.ServiceHelper.getUddiServerEndpointURL());
                    objService.doCall();
                };

                uddi.prototype.onassociateUDDIServersWithEnvironmentSuccess = function(objEvent) {
                    this.cancelEdit();
                };

                uddi.prototype.filterResults = function() {
                    if(this.tempCacheDoc) {
                        var tempCacheDoc = this.tempCacheDoc;
                    }
                    var filterEnable = this.selectBox.getText();

                    if(filterEnable == tibco.admin.Main.getServer().getDynamicProperty("@@Filter Option All")) {
                        filterEnable = "All";
                    }
                    if(filterEnable == tibco.admin.Main.getServer().getDynamicProperty("@@Filter Option All Enabled")) {
                        filterEnable = "true";
                    }
                    if(filterEnable == tibco.admin.Main.getServer().getDynamicProperty("@@Filter Option All Not Enabled")) {
                        filterEnable = "false";
                    }

                    this.mtxList.setXMLTransformers(tibco.admin.Main.resolveURI("tibco.admin", "tibco/admin/enterpriseAssets/envDef/envDtls/uddi/xsl/transform.xsl"));
                    this.mtxList.setXSLParam("enable", filterEnable);
                    this.mtxList.setSourceXML(tempCacheDoc);
                    this.mtxList.repaintData();
                };
            })

}